import { createApp } from "vue";
import App from "./App.vue";
//导入路由
import router from "@/router";
import ResizeObserver from "resize-observer-polyfill";
window.ResizeObserver = ResizeObserver;
import "./style.css";
//导入element-ui
import ElementPlus from "element-plus";
import "element-plus/dist/index.css";
//导入element-icon
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
//设置element-plus中文
import zhCn from "element-plus/es/locale/lang/zh-cn";

let app = createApp(App);
router.beforeEach((to, from, next) => {
  document.title = to.meta.name;
  next();
});
//注册路由
app.use(router);
//全局注册+配置中文包
app.use(ElementPlus, {
  locale: zhCn,
});
app.mount("#app");
